home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_06
/
saks
/
drftxmpl.h
< prev
Wrap
C/C++ Source or Header
|
1995-04-06
|
506b
|
25 lines
Listing 2 - The example from the C++ draft standard
illustrating the class scope rules.
typedef int c;
enum { i = 1 };
class X
{
char v[i]; // error: 'i' refers to ::i
// but when reevaluated is X::i
int f() { return sizeof(c); } // okay: X::c
char c;
enum { i = 2 };
};
typedef char* T;
struct Y
{
T a; // error: 'T' refers to ::T
// but when reevaluated is Y::T
typedef long T;
T b;
};